// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2021-2023. All rights reserved.
 * Description: Implement pal kernel/capability.c
 * Author: Huawei OS Kernel Lab
 * Create: Mon Nov 15 20:22:23 2021
 */

#include <linux/capability.h>
#include <linux/mm.h>
#include <linux/export.h>

struct inode;
bool capable_wrt_inode_uidgid(const struct inode *inode, int cap)
{
	return capable(cap);
}
EXPORT_SYMBOL(capable_wrt_inode_uidgid);

bool has_capability(struct task_struct *t, int cap)
{
	BUG_ON(t != current);
	return capable(cap);
}
EXPORT_SYMBOL(has_capability);

bool has_capability_noaudit(struct task_struct *t, int cap)
{
	BUG_ON(t != current);
	return capable(cap);
}

bool capable(int cap)
{
	return !!liblinux_pal_capable(cap);
}
EXPORT_SYMBOL(capable);
